package cn.zane.lottery.domain.strategy.service.draw;

import cn.zane.lottery.domain.strategy.model.aggregates.StrategyRich;
import cn.zane.lottery.domain.strategy.repository.IStrategyRepository;
import cn.zane.lottery.infrastructure.po.Award;

import javax.annotation.Resource;

/**
 * 提供抽奖策略数据支持，一些通用的数据服务<便于查询策略配置、奖品信息。通过这样的方式隔离职责
 */
public class DrawStrategySupport extends DrawConfig{

    @Resource
    protected IStrategyRepository strategyRepository;

    /**
     * 查询策略配置信息
     * @param strategyId    策略ID
     * @return 策略配置信息
     */
    protected StrategyRich queryStrategyRich(Long strategyId){
        return strategyRepository.queryStrategyRich(strategyId);
    }

    /**
     * 查询奖品详细信息
     * @param awardId 奖品ID
     * @return 奖品详细信息
     */
    protected Award queryAwardInfoByAwardId(String awardId){
        return strategyRepository.queryAwardInfo(awardId);
    }

}
